import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import LowcodeComponents from '@isameng/lowcode-components'
// 导入权限指令模块
import hasPermission from '@/directives/hasPermission'
// 导入全局样式
import '@/styles/index.scss'
// 导入权限控制模块
import './permission'
import '@isameng/lowcode-components/dist/bundle.css'
import 'cropperjs/dist/cropper.css'

const pinia = createPinia()
const app = createApp(App)
// const baseBackendURL = 'http://localhost:7001'
// axios.defaults.baseURL = `${baseBackendURL}/api/`
// axios.interceptors.request.use(config => {
//   const global = useGlobalStore()
//   global.startLoading()
//   return config
// })
// axios.interceptors.response.use(response => {
//   const global = useGlobalStore()
//   global.finishLoading()
//   return response
// })
app.use(pinia).use(router).use(hasPermission).use(LowcodeComponents).mount('#app')
